<template>
  <div>
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>权限列表</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card>
      <el-table :data="list" border style="width: 100%; margin-top: 16px">
        <el-table-column type="index" width="50"> </el-table-column>
        <el-table-column prop="authName" label="权限名称"> </el-table-column>
        <el-table-column prop="path" label="路径"> </el-table-column>
        <el-table-column label="权限等级">
          <template slot-scope="scope">
            <el-tag :type="types[scope.row.level]">{{
              scope.row.level | rank
            }}</el-tag>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>
<script>
import { GetquanApi } from '@/http/api'
export default {
  name: 'rightsA',
  data() {
    return {
      list: [],
      types: {
        0: 'primary',
        1: 'success',
        2: 'warning'
      }
    }
  },
  created() {
    this.getlist()
  },
  methods: {
    async getlist() {
      const res = await GetquanApi()
      console.log(res)
      this.list = res
    }
  }
}
</script>
